import axios from 'axios'

  export function post(url, paramss) {
    return new Promise((resolve, reject) => {
         axios.post(url,JSON.stringify(paramss)).
        then(res => {
            resolve(res.data);
        })
        .catch(err =>{
         
            reject(err.data)
        })
    });
  } 
  export function get(url, params){    
    return new Promise((resolve, reject) =>{        
        axios.get(url,JSON.stringify(params)).then(res => {
            resolve(res.data);
        }).catch(err =>{
            reject(err.data)        
    })    
  });}
  export function put(url, params){    
    return new Promise((resolve, reject) =>{        
        axios.put(url,JSON.stringify(params)).then(res => {
            resolve(res.data);
        }).catch(err =>{
            reject(err.data)        
    })    
  });}